package persistence;

import java.util.Calendar;

import core.Item;

/**
 * The data transfer object for items
 * @author Justin
 *
 */
public class ItemDTO
{
	private Item _item;
	/**
	 * Constructor for ItemDTO
	 * 
	 * @param item associated with the DTO
	 */
	public ItemDTO(Item item)
	{
		//TODO: not sure if there's anything left
		_item = item;
	}
	
	/**
	 * gets the barcode for the item's product
	 * @return the product's barcode
	 */
	public String getProductBarcode()
	{
		return _item.getProduct().getBarcode().toString();
	}
	
	/**
	 * gets the ID for the container the item is in
	 * @return the container's ID
	 */
	public int getContainerID()
	{
		return _item.getContainer().getID();
	}
	
	/**
	 * sets the ID for the container the item is in
	 */
	public void setContainerID(int id)
	{
		_item.getContainer().setID(id);
	}
	
	/**
	 * gets the barcode of the item
	 * @return the barcode
	 */
	public long getItemBarcode()
	{
		return Long.parseLong(_item.getBarcode().toString());
	}
	
	/**
	 * Gets the date the item was entered
	 * @return the entered date
	 */
	public Calendar getEntryDate()
	{
		return _item.getEntryDate();
	}
	
	/**
	 * Gets the date the item was used
	 * @return the used date
	 */
	public Calendar getExitDate()
	{
		return _item.getExitDate();
	}
}
